package com.jdbc.homework2;

/**
 * ClassName: User
 * Passage: com.jdbc.homework2
 * Description:
 *
 * @Author 余大帅逼
 * @Create 2025/2/26 20:27
 * @Version 1.0
 **/
public class User {
    private int id;
    private String username;
    private String password;
    private Integer points; // 使用 Integer 类型以支持 null 值
    private String phone;
    private boolean isAdmin; // 确保与数据库字段名一致

    public User() {
    }

    public User(int id, String username, String password, Integer points, String phone, boolean isAdmin) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.points = points;
        this.phone = phone;
        this.isAdmin = isAdmin;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public boolean isAdmin() {
        return isAdmin;
    }

    public void setAdmin(boolean admin) {
        isAdmin = admin;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", points=" + points +
                ", phone='" + phone + '\'' +
                ", isAdmin=" + isAdmin +
                '}';
    }
}
